package com.example.demo;


/**
 * Created by zhangqidzq on 2017/9/10.
 */
public class Response {
    private Boolean isSuccess;

    private String errorMsg;
    private Object data;

    public Response(Boolean isSuccess, String errorMsg, Object data) {
        this.isSuccess = isSuccess;
        this.errorMsg = errorMsg;
        this.data = data;
    }

    public static Response ofSuccess(Object data) {
        return new Response(Boolean.TRUE, null, data);
    }

    public static Response ofFailure(String errorMsg) {
        return new Response(Boolean.FALSE, errorMsg, null);
    }
}
